<%@ page language="java" contentType="text/html; charset=UTF-8"	pageEncoding="UTF-8"%>
<%@ taglib uri="http://www.springframework.org/security/tags"	prefix="sec"%>
<%@ taglib uri="http://www.springframework.org/tags/form" prefix="form"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/functions" prefix="fn"%>
<%@ taglib prefix="spring" uri="http://www.springframework.org/tags"%>

<hgroup class="intro">
	<h1 class="title" id="h1_title">RestFinder</h1>
	<h3 class="tagline">Pierwszy portal rekomendacyjny o restauracjach	w Twoim mieście</h3>
</hgroup>
<div class="reservations">
	 <sec:authorize ifAnyGranted="ROLE_ANONYMOUS">  
		 <form  id="loginForm" action="/login" >
		 	<label for="username">Login:</label>
			<br/>
			<input type="text" name="username" id="username">
			<span style="color:red" id="error_username" ></span>
			<br/>
			<label for=password>Hasło</label>
			<br/>
			<input type="password" name="password" id="password">
			<span style="color:red" id="error_password" ></span>
			<br/>
			<br/>
			<span class="button" onclick="login()">Zaloguj</span>
		 </form>
	 </sec:authorize>
	 <sec:authorize ifNotGranted="ROLE_ANONYMOUS" >
	 	 Witaj, ${loggedUser.name } (${loggedUser.username}) !
	 	 <img src="${loggedUser.avatarSrc }" height="64" width="64" />
	 	 <br/><br/>
	 	 <span class="button" onclick="logout()">Wyloguj</span>
	 </sec:authorize>
</div>

